package cn.iocoder.yudao.module.promotion.dal.mysql.wechatservice;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.promotion.controller.admin.wechatservice.vo.WechatServiceExportReqVO;
import cn.iocoder.yudao.module.promotion.controller.admin.wechatservice.vo.WechatServicePageReqVO;
import cn.iocoder.yudao.module.promotion.dal.dataobject.wechatservice.WechatServiceDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 微信客服 Mapper
 *
 * @author 超级管理员
 */
@Mapper
public interface WechatServiceMapper extends BaseMapperX<WechatServiceDO> {

    default PageResult<WechatServiceDO> selectPage(WechatServicePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<WechatServiceDO>()
                .likeIfPresent(WechatServiceDO::getName, reqVO.getName())
                .eqIfPresent(WechatServiceDO::getRemark, reqVO.getRemark())
                .eqIfPresent(WechatServiceDO::getStatus, reqVO.getStatus())
                .betweenIfPresent(WechatServiceDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(WechatServiceDO::getId));
    }

    default List<WechatServiceDO> selectList(WechatServiceExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<WechatServiceDO>()
                .likeIfPresent(WechatServiceDO::getName, reqVO.getName())
                .eqIfPresent(WechatServiceDO::getRemark, reqVO.getRemark())
                .eqIfPresent(WechatServiceDO::getStatus, reqVO.getStatus())
                .betweenIfPresent(WechatServiceDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(WechatServiceDO::getId));
    }

}
